import fetch from 'utils/fetch';

export function page(query) {
  return fetch({
    url: '/api/admin/bizResumeMain/page',
    method: 'get',
    params: query
  });
}

export function addObj(obj,type) {
  var urlTemp = '';
  switch(type){
    case 'baseForm':
      urlTemp = '/api/admin/bizResumeBase/update';
      break;
    case 'eduForm':
     urlTemp = '/api/admin/bizResumeEdu/update';
      break;
    case 'workForm':
     urlTemp = '/api/admin/bizResumeWork/update';
      break;
    case 'myCommentForm':
      urlTemp = '/api/admin/bizResumeComment/update';
      break;
    default:
      urlTemp = '';
      break;
  }
  return fetch({
    url: urlTemp,
    method: 'post',
    data: obj
  });
}

export function getObj(id) {
  return fetch({
    url: '/api/admin/user/' + id,
    method: 'get'
  })
}
//获取当前用户身份证号
export function getIdCardObj() {
  return fetch({
    url: '/api/admin/bizUseridcardRelate/findBIzUserIdCardRelate',
    method: 'get'
  })
}
//绑定身份证号
export function addIdCardRelateObj(obj) {
  return fetch({
    url: '/api/admin/bizUseridcardRelate',
    method: 'post',
    data: obj
  })
}
//获取基本信息-当前所在地列表
export function getAreaListObj(pid) {
  return fetch({
    url: '/api/admin/bizArea/getArea?pid=' + pid,
    method: 'get'
  })
}
//获取届下面的学校列表
export function getSchoolListObj(obj) {
  return fetch({
    url: '/api/admin/bizSchool/querySchoolAll',
    method: 'post',
    data: obj
  })
}
//获取当前用户的简历base
export function getResumeBaseObj(idCard) {
  return fetch({
    url: '/api/admin/bizResumeBase/getBase?idCard=' + idCard,
    method: 'get'
  })
}
//获取当前用户的简历edu
export function getResumeEduObj(idCard) {
  return fetch({
    url: '/api/admin/bizResumeEdu/getEdu?idCard=' + idCard,
    method: 'get'
  })
}
//获取当前用户的简历work
export function getResumeWorkObj(idCard) {
  return fetch({
    url: '/api/admin/bizResumeWork/getWork?idCard=' + idCard,
    method: 'get'
  })
}
//获取当前用户的简历comment
export function getResumeCommentObj(idCard) {
  return fetch({
    url: '/api/admin/bizResumeComment/getComment?idCard=' + idCard,
    method: 'get'
  })
}

export function getUserResumeObj() {
  return fetch({
    url: '/api/admin/bizResumeBase/getUserResume',
    method: 'get'
  })
}

export function delEduObj(id) {
  return fetch({
    url: '/api/admin/bizResumeEdu/' + id,
    method: 'delete'
  })
}

export function delWorkObj(id) {
  return fetch({
    url: '/api/admin/bizResumeWork/' + id,
    method: 'delete'
  })
}

export function delObj(id) {
  return fetch({
    url: '/api/admin/user/' + id,
    method: 'delete'
  })
}

export function putObj(id, obj) {
  return fetch({
    url: '/api/admin/user/' + id,
    method: 'put',
    data: obj
  })
}

//获取班级列表
export function getClassListObj(obj) {
  return fetch({
    url: '/api/admin/bizClass/getClassList',
    method: 'post',
    data: obj
  })
}
